package com.gzy.cbrsystem.insomnia.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import java.util.*;

public class LogoutAction extends ActionSupport{
	private String username;
	public String execute() throws Exception{
		ActionContext actionContext =ActionContext.getContext();
		Map session = actionContext.getSession();
		if(session.size()!=0){
		
			session.remove("password");
			session.remove("username");
		session.clear();
		return SUCCESS;
		}
		else
			return ERROR;
		
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
}
